package com.itheima.d8_demo;

/**
 * 卡片类
 */
public class Card {
    String carNumber;
    String name;
    String phone;
    double money;

    public Card() {
    }

    public Card(String carNumber, String name, String phone, double money) {
        this.carNumber = carNumber;
        this.name = name;
        this.phone = phone;
        this.money = money;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }


    //写一个存款功能
    public void deposit(double money){
        this.money += money;
    }

    //写一个消费功能
    public void consume(double money){
        this.money -= money;
    }

}
